#include <iostream>
using namespace std;
int main()
{
    int n;
    while (cin>>n)
    {
        if (n==0)break;
        char name[1000][100];
        int i,t=0,j,a,b,s[2001],r=0;
        memset(s,0,sizeof(s));
        for (i=0;i<n;i++)
        {
            cin>>name[t];
            a=t;
            for (j=0;j<t;j++)
                if (strcmp(name[j],name[t])==0){a=j;t--;break;}
            if (r<a) r=a;
            t++;
            cin>>name[t];
            a=t;
            for (j=0;j<t;j++)
                if (strcmp(name[j],name[t])==0){a=j;t--;break;}
            s[a]=-1;
            if (r<a) r=a;
            t++;
        }
        int v=0;
        for (i=0;i<=r;i++)if (s[i]==0)v++;
        if (v==1)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}
